package cn.edu.hznu.coursework.entity;

import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table
@DynamicUpdate(true)
public class StudentWork extends AbstractIndentifiedEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3028837250453049348L;
	
	@ManyToOne(fetch = FetchType.LAZY)
	private Student student;
	
	@ManyToOne(fetch = FetchType.LAZY)
	private Course course;
	
	@Column
	private String filePath;
	
	@Column
	private int score;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	private Calendar submitDate;
	
	@Column
	private boolean isSubmitted;
	
	@ManyToOne(fetch = FetchType.LAZY)
	private TeacherWork teacherWork;

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public Calendar getSubmitDate() {
		return submitDate;
	}

	public void setSubmitDate(Calendar submitDate) {
		this.submitDate = submitDate;
	}

	public boolean isSubmitted() {
		return isSubmitted;
	}

	public void setSubmitted(boolean isSubmitted) {
		this.isSubmitted = isSubmitted;
	}

	public TeacherWork getTeacherWork() {
		return teacherWork;
	}

	public void setTeacherWork(TeacherWork teacherWork) {
		this.teacherWork = teacherWork;
	}
	
}
